package values.skill
{
import flash.errors.IllegalOperationError;
import flash.utils.Dictionary;
SkillValue;
SkillLevelValue;
LogicEffectValue;
ImmediateEffectValue;
BaseDamageValue;
AdditionalEffectValue;
BuffDebuffEffectValue;

/**
 * SkillTemplateValueList
 * @author jliang
 *
 */
public class SkillTemplateValueList
{
	private static var list:Dictionary = new Dictionary(true); /* SkillTemplateValue */
	
	public function get skills():Dictionary
	{
		return list;
	}
	
	[Data(type="mapping", 
		   mapping="skill", 
		   ref="$@templateRef",
		   way="one_to_more",
		   object="flash.utils.Dictionary",
           key="@key")]
	public function set skills(value:Dictionary):void
	{
		list = value;
	}
	
	public static function get skillList():Dictionary
	{
		return list;
	}
	
	public static function getByKey(key:String):SkillTemplateValue
	{
		var skill:SkillTemplateValue = list[key];
		if (!skill)
		{
			throw new IllegalOperationError("Cannot find <" + key + "> Skill. Please check data configuration.");
		}
		return skill;
	}
}
}




